package com.boful.common.file.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;

import org.apache.commons.codec.binary.Hex;

public class EncoderUtils {
	/**
	 * 取source的hash
	 * 
	 * @param source
	 * @return
	 */
	public static byte[] md5(byte[] source) {
		try {
			MessageDigest digest = MessageDigest.getInstance("MD5");
			digest.update(source);
			return digest.digest();
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		return null;
	}

	public static void main(String[] args) {
		
		
	}
}
